<script setup lang="ts">
import { buildUrl } from 'cloudinary-build-url'

const { publicId, alt } = defineProps<{
  publicId: string
  alt?: string
}>()

const prefix = 'battcn/'

const url = buildUrl(prefix + publicId, {
  cloud: {
    cloudName: '唐亚峰 | battcn',
  },
})
</script>

<template>
  <div class="overflow-hidden rounded my-2 md:my-4">
    <img :src="url" :alt="alt ?? publicId">
  </div>
</template>
